<?php
echo $this->Html->css(array('plugins/chosen/chosen','plugins/multiselect/multi-select','plugins/datepicker/datepicker'),null,array('inline'=>false));
echo $this->Html->script(array('plugins/chosen/chosen.jquery.min','plugins/datepicker/bootstrap-datepicker'),array('inline'=>false));
?>
<div class="row-fluid">
    <div class="span12">
        <div class="box box-color box-bordered">
            <div class="nomargin box-title">
                <h3>Listagem das Generos</h3>
                <div class="actions">
                    <?php echo $this->Html->link('<i class="icon-plus-sign"></i> Nova',array('controller'=>'genres','action'=>'add'),array('class'=>'btn btn-primary','escape'=>false,'rel'=>"tooltip",'data-placement'=>"left",'data-original-title'=>"Adicionar no anime.")); ?>
                </div>
            </div>
            <div class="box-content nopadding">
                <table class="table table-hover table-nomargin dataTable table-bordered dataTable-scroll-y dataTable-scroll-x">
                    <thead>
                    <tr>
                        <th><?php echo $this->Paginator->sort('name'); ?></th>
                        <th class="span2 text-center"><?php echo $this->Paginator->sort('status'); ?></th>
                        <th class="actions"><?php echo __('Actions'); ?></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php
                    if(!empty($genres)):
                        foreach ($genres as $genre):
                            ?>
                            <tr>
                                <td><?php echo h($genre['Genre']['name']); ?>&nbsp;</td>
                                <td> <?php echo $this->Html->link($this->Function->Status($genre['Genre']['status']),'javascript:;',array('escape'=>false,'class'=>"status",'id'=>$genre['Genre']['id'],'data-sourse'=>$this->webroot.'genres/','data-value'=>$genre['Genre']['status']))?></td>
                                <td style="width: 15px;">
                                    <div class="btn-group">
                                        <div class="btn-group">
                                            <?php
                                            echo $this->Html->link('<i class="icon icon-edit"></i>',array('controller'=>'genres','action'=>'edit',$genre['Genre']['id']),array('class'=>'btn btn-inverse','escape'=>false));
                                            echo $this->Html->link('<i class="icon icon-eye-open"></i>',array('controller'=>'genres','action'=>'view',$genre['Genre']['id']),array('class'=>'btn btn-inverse linkModal','escape'=>false));
                                            ?>
                                        </div>
                                        <?php
                                        echo $this->Form->postLink(__('<i class="icon icon-trash"></i>'), array('action' => 'delete', $genre['Genre']['id']), array('escape'=>false,'class'=>'btn btn-danger'), __('Deseja remover:\n%s?', $genre['Genre']['name']));
                                        ?>
                                    </div>
                                </td>
                            </tr>
                        <?php
                        endforeach;
                    else:
                        ?>
                        <tr>
                            <td colspan="2"><span class="alert alert-info span12 nomargin"><strong>INFORMAÇÃO:&nbsp;</strong>Não foi encontrado resultado em nosso banco</span></td>
                        </tr>
                    <?php endif;?>
                    </tbody>
                </table>
                <?php echo $this->Element('_paginate')?>
            </div>
        </div>
    </div>
</div>
<?php echo $this->Element('_modalView');?>
